package org.springleaf.core.mvc.view;

import org.springframework.web.servlet.ModelAndView;
import org.springleaf.core.json.JsonData;

/**
 * JSON模型视图
 * @author leaf
 */
public class JSONModelAndView extends ModelAndView{
	
	public static final String KEY = "JSONMODELANDVIEW_JSONDATA";
	public static final String VIEW_ID = "jsonView";
	
	public JSONModelAndView(Object obj){
		super(VIEW_ID);
		this.addObject(KEY,obj);
	}
	
	public JSONModelAndView(boolean isSuccess,String msg,Object result){
		this(new JsonData(isSuccess, msg, result));
	}
	
	public JSONModelAndView(boolean isSuccess,String msg){
		this(new JsonData(isSuccess, msg));
	}

}
